! Globals.f 
! Created 8/27/91 9:37 by AppMaker 

!!MP inlines.f
!!G JLtest.finc.f

!!D+
!!R+
!!OV+
!!S Globals 

!----------
	Subroutine InitGlobals
	include 'Globals.inc'
	QDG = JQDGlobals()
	curWindow = nil
	nocur.text.TEH = nil
	nocur.vScroll.CtlH = nil
	nocur.hScroll.CtlH = nil
	nocur.fileNum = 0
	nocur.volNum = 0
	nocur.dirty = .false.
	nocur.windowKind = noWindow
	cur = %loc(noCur)
	End !InitGlobals

!----------
	Subroutine SetInfo (window)
	include 'Globals.inc'
	pointer /grafport/ window
	pointer /WinInfoRec/ infoPtr

	if (window <> curWindow) then 
		curWindow = window
		if (curWindow <> nil) then 
			infoPtr = GetWRefCon (curWindow)
			cur = infoPtr
		else 
			cur = %loc(noCur)
		end if
	end if
	End !SetInfo

!----------
	Subroutine SetNewInfo (window)
	pointer /grafport/ window
	pointer /WinInfoRec/ infoPtr

	infoPtr = NewPtr (Jsizeof (WinInfoRec))
	Call SetWRefCon (window, INT4(infoPtr))
	Call SetInfo (window)
	End !SetNewInfo

!----------
	Subroutine DiscardInfo (window)
	include 'Globals.inc'
	pointer /grafport/ window, localwin
	pointer /WinInfoRec/ infoPtr

	localwin = window
	if (localwin = curWindow) then 
		Call SetInfo (nil)
	end if
	infoPtr = GetWRefCon (localwin)
	Call DisposPtr (infoPtr)
	Call HideWindow (localwin)
	Call DisposeWindow (localwin)
	End !DiscardInfo


